from django.conf.urls import patterns, url

urlpatterns = patterns('forum.views',
    url(r'^$', 'index', name='index'),

    url(r'^b/(?P<tboard>[a-zA-Z][a-zA-Z0-9]{2,20})/$', 'board', name='board'),
    url(r'^b/(?P<tboard>[a-zA-Z][a-zA-Z0-9]{2,20})/(?P<page>\d+)$', 'board', name='specific_boardpage'),

    url(r'^t/(?P<id>\d+)/$', 'topic', name='topic'),
    url(r'^t/(?P<id>\d+)/(?P<page>\d+)/$', 'topic', name='specific_page'),
    url(r'^p/(?P<id>\d+)/$', 'single_post', name='single_post'),
    url(r'^a/(?P<tboard>[a-zA-Z][a-zA-Z0-9]{2,20})/$', 'new_topic', name='new_topic'),
    url(r'^r/(?P<id>\d+)/$', 'reply', name='reply'),
    url(r'^e/(?P<id>\d+)/$', 'edit_topic', name='edit_topic'),
    url(r'^d/t/(?P<id>\d+)/$', 'delete_topic', name='delete_topic'),

    url(r'^d/p/(?P<id>\d+)/$', 'delete_push', name='delete_push'),
    url(r'^a/(?P<id>\d+)/$', 'new_push', name='new_push'),
    url(r'^push/(?P<id>\d+)/$', 'get_push', name='get_push'),

    url(r'^u/(?P<action>login|logout|register|auth|ajaxlogin|add|del|update|ban)/$', 'member_operate', name='member_operate'),
    #url(r'^u/(?P<uid>\d+)/$', 'member_profile', name='member_profile'),

    url(r'^manage/$', 'manage', name='manage_dashboard'),
    url(r'^manage/(?P<part>[a-zA-Z0-9_]+)/$', 'manage', name='manage'),
    url(r'^m/b/(?P<action>add|update|del)/(?P<id>\d*)/?$', 'board_manage', name='board_manage'),
    url(r'^m/bc/(?P<action>add|update|del)/(?P<id>\d*)/?$', 'boardcategory_manage', name='boardcategory_manage'),
    url(r'^m/m/(?P<action>create|update|del)/(?P<id>\d*)/?$', 'message_manage', name='message_manage'),
    url(r'^m/ajax/board/(?P<id>\d+)/perm/(?P<perm_str>[01]{5})/$', 'board_manage', {'action': 'update'}, name='board_manage_perm'),

    url(r'^attachment/(?P<action>upload|del|change)/$', 'attachment', name='attachment'),

    url(r'^message/$', 'message', name='message'),

    url(r'^html/(?P<filename>.+)/$', 'get_html', name='get_html'),
)
